<script setup>
import { onLaunch } from "@dcloudio/uni-app";
import { useAppInfoStore } from "@/stores/appInfo";

const appInfoStore = useAppInfoStore();

const saveDeviceInfo = (res) => {
  // 获取设备信息
  let statusBar = 0;
  statusBar = res.statusBarHeight;
  console.log(statusBar);

  const navBarHeight = res.statusBarHeight;
  const deviceId = res.deviceId;
  const deviceBrand = res.deviceBrand;

  appInfoStore.setInfo();
};

onLaunch(() => {
  // 获取系统信息,异步，回调
  uni.getSystemInfo({
    success: function (res) {
      console.log(res);
      saveDeviceInfo(res);
    },
  });
});
</script>

<style>
/*每个页面公共css */
</style>
